#pragma once

/*	File:	Geometry_Pool.h
 *	
 * This class holds every model loaded onto ram. Geometry should ideally be
 * placed on the graphics device memory. With this class, duplicate models
 * will not be loaded at the same time.
 * 
 * ALL MODEL LOADING SHOULD OCCUR THROUGH THIS CLASS.
 * 
 * Loads models with Assimp.
 *  
 * This class will also hold things like billboards. If it's got vertices
 * it is pooled here for uniqueness.
 */

#include <unordered_map>	// http://www.codeguru.com/cpp/cpp/cpp_mfc/stl/article.php/c15303__2/A-TR1-Tutorial-Unordered-Containers.htm.

class Model;

class Geometry_Pool
{
public:
	Geometry_Pool(void);
	~Geometry_Pool(void);

	// Add a key name and a Model value to the pool. Will not add the pair
	// if they already exist in the pool.
	bool add_model(std::string key, Model &value);

	// Get a model from a key value pair.
	Model* get_modelValue(std::string key);

	// Return T/F if the key exists in the geometry pool.
	bool isPooled( std::string key );

	void Clear_Pool();
private:

	void delete_pool_vertices();

	// An unordered map (key-value pair) of models used in the game.
	std::tr1::unordered_map<std::string, Model> model_pool;
};

